#! /bin/bash


git commit -am "no message"
git push origin master

C_Production=production
C_Staging=staging

echo "=============================="
echo "Publish to mbs-api.hongdaoit.com:"
echo "=============================="
echo "type \""$C_Production"\" for Publish to mbs-api.hongdaoit.com env"
echo "type \""$C_Staging"\" for Publish to mbs-api-staging.hongdaoit.com env"

read -p "type your select(production/staging):" value
keyInput=$value
if [ "$keyInput" = "$C_Production" ]; then
   ssh root@www.hongdaoit.com	"cd /home/mbs/mbs-api.hongdaoit.com && /bin/bash ./tools/server_tools/publish.sh"

elif [ "$keyInput" = "$C_Staging" ]; then
   ssh root@www.hongdaoit.com	"cd /home/mbs/mbs-api.hongdaoit.com && /bin/bash ./tools/server_tools/publish.sh"

else  echo "your input is invalid !"
fi
